package com.springboot.mybatis.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.springboot.mybatis.mapper.UserMapper;
import com.springboot.mybatis.model.User;
import com.springboot.mybatis.service.UserService;

@Service
public class UserServiceImpl implements UserService{

    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> getAll() {
        return userMapper.getAll();
    }

    @Override
    public User findUserById(long id) {
        return userMapper.findUserById(id);
    }

    @Override
    public void insert(User user) {
        userMapper.insert(user);
    }

    @Override
    public int update(User user) {
        System.out.println("update数据：" + user);
        return userMapper.update(user);
    }

    @Override
    public int delete(long id) {
        return userMapper.delete(id);
    }
}


